{extend name="layout/main" /}

{block name="header"}

{/block}

{block name="content"}
<section class="panel">
    <header class="panel-heading">
        <h4>审核列表</h4>
    </header>
    <div class="panel-body" style="padding-bottom: 50px">
        <form class="form-horizontal" action="">
            <div class="form-group">

                <div class="col-xs-2 no-pd-r">
                    <select name="type" class="form-control">
                        <option {if $Request.get.type == 'mobile'} selected {/if}   value="mobile">账号</option>
                        <option {if $Request.get.type == 'city'} selected {/if}   value="city">市</option>
                        <option {if $Request.get.type == 'area'} selected {/if}   value="area">区</option>
                    </select>
                </div>
                <div class="col-xs-3">
                    <input type="text" value="" name="keyword" class="form-control"
                           placeholder="请输入搜索内容">
                </div>
                <div class="col-xs-2 no-pd-r">
                    <select name="status" class="form-control">
                        <option {if !$Request.get.status} selected {/if}   value="">审核状态</option>
                        <option {if $Request.get.status == '1'} selected {/if}   value="1">待审核</option>
                        <option {if $Request.get.status == '2'} selected {/if}   value="2">通过</option>
                        <option {if $Request.get.status == '3'} selected {/if}   value="3">拒绝</option>
                    </select>
                </div>
                <button type="submit" class="btn btn-color">搜索</button>
                <!--<a type="button" href="{:url('admin/Excelexport/partnerrList')}" class="btn btn-info">导出</a>-->
            </div>
        </form>
        <table class="table table-bordered table-striped no-margin">
            <thead>
            <tr>
                <th class="text-center">ID</th>
                <th class="text-center">用户账户</th>
                <th class="text-center">申请类型</th>
                <th class="text-center">地区</th>
                <th class="text-center">申请时间</th>
                <th class="text-center">状态</th>
                <th class="text-center">审核时间</th>
                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            {if !empty($lists)}
            {foreach $lists as $entity}
            <tr>
                <td class="text-center">{$entity.id}</td>
                <td class="text-center">{$entity.mobile}</td>
                <td class="text-center">{if $entity.type == 1}申请市代理{else}申请区代理{/if}</td>
                <td class="text-center">{$entity.province} {$entity.city} {$entity.area}</td>
                <td class="text-center">{:date('Y-m-d H:i:s',$entity.create_time)}</td>
                <td class="text-center">
                    {if $entity.status == 1}<span class="btn btn-xs btn-default">待审核</span>
                    {elseif $entity.status == 2}<span class="btn btn-xs btn-success">通过</span>
                    {elseif $entity.status == 3}<span class="btn btn-xs btn-danger">拒绝</span>
                    {/if}
                </td>
                <td class="text-center">{if $entity.update_time}{:date('Y-m-d H:i:s',$entity.update_time)}{/if}</td>
                <td class="text-center">
                    {if $entity.status == 1}
                    <a data-url="{:url('partnerr_pass_yes',['id'=>$entity.id])}" onclick="main.ajaxDelete(this)" data-msg="确定要通过申请吗？" class="btn btn-xs btn-info">通过</a>
                    <a data-url="{:url('partnerr_pass_no',['id'=>$entity.id])}" onclick="main.ajaxDelete(this)" data-msg="确定要拒绝申请吗？" class="btn btn-xs btn-danger">拒绝</a>
                    {/if}
                </td>
            </tr>
            {/foreach}
            {else /}
            <tr class="text-center">
                <td colspan="5">暂无数据</td>
            </tr>
            {/if}
            </tbody>
        </table>
        <div class="page">
            {:htmlspecialchars_decode($lists->render())}
        </div>
    </div>
</section>
{/block}


{block name="footer"}
    <script>
        function showContent(e){
            $.dialog({
                title: '图片',
                content: $(e).attr('data-content')
            });
        }
    </script>
{/block}